package com.atguigu.spzx.model.entity.system;

public class SysUserThreadLocalAuthContextUtil {
    public static final ThreadLocal<SysUser> threadLocal = new ThreadLocal<>();

    /**
     * 定义存储数据的静态方法
     *
     * @param sysUser {@link SysUser}
     */
    public static void set(SysUser sysUser) {
        threadLocal.set(sysUser);
    }

    /**
     * 定义获取数据的方法
     *
     * @return {@link SysUser}
     */
    public static SysUser get() {
        return threadLocal.get();
    }

    /**
     * 删除数据的方法
     */
    public static void remove() {
        threadLocal.remove();
    }

}
